
import request from '@/utils/request';
import { ResultRole } from './definitions/ResultRole';
import { RoleRequest } from './definitions/RoleRequest';
import { ResultListRole } from './definitions/ResultListRole';
import { Result } from './definitions/Result';


export class RoleAdminController {

    static addUsingPOSTPath: string = "/v1/admin/role";
    /// 新增ROLE
    async addUsingPOST(data: RoleRequest, headers?: any):  Promise<ResultRole> {
      return request(`/v1/admin/role`, {
        method: "POST",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static listUsingGETPath: string = "/v1/admin/role/list";

    async listUsingGET( headers?: any) : Promise<ResultListRole> {
      return request(`/v1/admin/role/list`, {
        method: "GET",
        headers: headers,
      }) as Promise<any>;
    }
    
    static updateUsingPUTPath: string = "/v1/admin/role/{id}";
    /// 更新ROLE
    async updateUsingPUT(id: string, data: RoleRequest, headers?: any):  Promise<any> {
      return request(`/v1/admin/role/${id}`, {
        method: "PUT",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static deleteUsingDELETEPath: string = "/v1/admin/role/{id}";

    async deleteUsingDELETE(id: string,  headers?: any) : Promise<any> {
      return request(`/v1/admin/role/${id}`, {
        method: "DELETE",
        headers: headers,
      }) as Promise<any>;
    }
    
}